package org.dromara.system.domain.bo;

import org.dromara.common.core.validate.AddGroup;
import org.dromara.common.core.validate.EditGroup;
import org.dromara.system.domain.SysCommonFields;
import org.dromara.common.mybatis.core.domain.BaseEntity;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.NoArgsConstructor;
import lombok.EqualsAndHashCode;

import java.io.Serial;

import jakarta.validation.constraints.*;

/**
 * 常用字段业务对象 sys_common_fields
 *
 * @author yilong.fu
 * @date 2024-11-24
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = SysCommonFields.class, reverseConvertGenerate = false)
public class SysCommonFieldsBo extends BaseEntity {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @NotNull(message = "主键不能为空", groups = {EditGroup.class})
    private Long id;

    /**
     * 列说名
     */
    @NotBlank(message = "列说名不能为空", groups = {AddGroup.class, EditGroup.class})
    private String fieldName;

    /**
     * 列名
     */
    @NotBlank(message = "列名不能为空", groups = {AddGroup.class, EditGroup.class})
    private String field;

    /**
     * 类型
     */
    @NotBlank(message = "类型不能为空", groups = {AddGroup.class, EditGroup.class})
    private String dataType;

    /**
     * 长度
     */
    private String dataLength;

    /**
     * 是否为空（1允许，0不允许）
     */
    @NotNull(message = "是否为空（1允许，0不允许）不能为空", groups = {AddGroup.class, EditGroup.class})
    private Long allowNull;

    /**
     * 描述说明
     */
    private String description;

    /**
     * 排序
     */
    private Integer seq;


}
